/**
 * @project sso-token-start V1.0
 * @Title:  TokenServiceConfig.java  
 * @Package com.gitee.kinbug.sso.config 
 * Copyright(c) 2020 KinBug Co. Ltd. 
 * All right reserved. 
 */
package com.gitee.kinbug.sso.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.gitee.kinbug.sso.properties.SsoTokenProperties;
import com.gitee.kinbug.sso.store.SsoServiceStore;

import lombok.extern.slf4j.Slf4j;

/**
 * Description:TODO(初始化redis的RedisTemplate)
 * @author: KinBug
 */
@Slf4j
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(value = "kinbug.sso.is-service", matchIfMissing = false)
@EnableConfigurationProperties(SsoTokenProperties.class)
public class TokenServiceConfig{
	
	@Autowired
	private SsoTokenProperties ssoTokenProperties;
	
	@Bean
	public SsoServiceStore ssoServiceStore() {
		log.info(">>>>>>>>>>服务端 token验证的KEY："+ssoTokenProperties.getAuthKey());
		log.info(">>>>>>服务端登录用户SESSION的KEY："+ssoTokenProperties.getLoginUser());
		return new SsoServiceStore(ssoTokenProperties);
	}
}
